export const mallColumns = [
  {
    title: 'SMTP服务器域名',
    dataIndex: 'host',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请输入SMTP服务器域名',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'SMTP服务端口',
    initialValue: '465',
    dataIndex: 'port',
    valueType: 'digit',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请输入SMTP服务端口',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '用户名密码验证',
    dataIndex: 'isPassword',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    valueType: 'select',
    valueEnum: {
      '0': { text: '是', value: '0' },
      '1': {
        text: '否',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    valueType: 'dependency',
    name: ['isPassword'],
    //@ts-ignore
    columns: ({ isPassword }) => {
      if (isPassword === '0') {
        return [
          {
            title: '用户名',
            dataIndex: 'username',
            tooltip: '发件人邮箱地址（如果使用foxmail邮箱，此处为qq号）',
            formItemProps: {
              rules: [
                {
                  required: true,
                  message: '请输入用户名',
                },
              ],
            },
            width: 'md',
            colProps: {
              xs: 24,
              md: 12,
              lg: 12,
            },
          },
          {
            title: '密码',
            dataIndex: 'passowrd',
            tooltip: '注意，某些邮箱需要为SMTP服务单独设置密码，详情查看相关帮助',
            valueType: 'password',
            formItemProps: {
              rules: [
                {
                  required: true,
                  message: '请输入密码',
                },
              ],
            },
            width: 'md',
            colProps: {
              xs: 24,
              md: 12,
              lg: 12,
            },
          },
          {
            title: '发送方',
            dataIndex: 'sendName',
            tooltip:
              '邮件中显示的发件人姓名，遵循RFC-822标准。支持以下形式：1.user@xxx.xx 2.name <user@xxx.xx>',
            formItemProps: {
              rules: [
                {
                  required: true,
                  message: '请输入发送方',
                },
              ],
            },
            width: 'md',
            colProps: {
              xs: 24,
              md: 12,
              lg: 12,
            },
          },
        ];
      }
      return [];
    },
  },
  {
    title: '调试模式',
    dataIndex: 'debug',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    tooltip: '是否打开调试模式，调试模式会显示与邮件服务器通信过程，默认不开启',
    valueType: 'select',
    valueEnum: {
      '0': { text: '开启', value: '0' },
      '1': {
        text: '关闭',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '超长参数切分',
    dataIndex: 'slice',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    tooltip: '对于超长参数是否切分为多份，默认为false（国内邮箱附件不支持切分的附件名）',
    valueType: 'select',
    valueEnum: {
      '0': { text: '是', value: '0' },
      '1': {
        text: '否',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '使用charset编码',
    dataIndex: 'charset',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    tooltip: '对于文件名是否使用charset编码，默认为 true',
    valueType: 'select',
    valueEnum: {
      '0': { text: '是', value: '0' },
      '1': {
        text: '否',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'STARTTLS安全连接',
    dataIndex: 'starttls',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    tooltip:
      '使用 STARTTLS安全连接，STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接（TLS或SSL）， 而不是使用一个单独的加密通信端口。',
    valueType: 'select',
    valueEnum: {
      '0': { text: '是', value: '0' },
      '1': {
        text: '否',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'SSL安全连接',
    dataIndex: 'ssl',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    valueType: 'select',
    valueEnum: {
      '0': { text: '是', value: '0' },
      '1': {
        text: '否',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'SSL协议',
    dataIndex: 'sslProtocol',
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'socketFactoryClass',
    dataIndex: 'socketFactoryClass',
    initialValue: 'javax.net.ssl.SSLSocketFactory',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '创建套接字工厂类',
    dataIndex: 'factory',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    tooltip:
      '如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true',
    valueType: 'select',
    valueEnum: {
      '0': { text: '是', value: '0' },
      '1': {
        text: '否',
        value: '1',
      },
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'Socket端口',
    initialValue: 465,
    dataIndex: 'socketPort',
    valueType: 'digit',
    tooltip: '指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'Socket端口',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'SMTP超时时长',
    initialValue: 0,
    tooltip: 'SMTP超时时长，单位毫秒，缺省值不超时',
    dataIndex: 'smtpTimeout',
    valueType: 'digit',
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'Socket连接超时值',
    initialValue: -1,
    dataIndex: 'timeout',
    tooltip: 'Socket连接超时值，单位毫秒，缺省值不超时',
    valueType: 'digit',
    fieldProps: {
      min: -1,
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'Socket写出超时值',
    initialValue: -1,
    tooltip: 'Socket写出超时值，单位毫秒，缺省值不超时',
    dataIndex: 'writeTimeout',
    valueType: 'digit',
    width: 'md',
    fieldProps: {
      min: -1,
    },
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
];
//阿里云SMS
export const smsAliyunColumns = [
  {
    title: 'accessKey',
    dataIndex: 'accessKey',
    tooltip:
      '如何获取AccessKey，请查询: (https://help.aliyun.com/document_detail/116401.htm) 或<br /> (https://usercenter.console.aliyun.com/#/manage/ak)',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'accessKey不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'accessKeySecret',
    dataIndex: 'accessKeySecret',
    tooltip: '阿里云的accessKeySecret',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'accessKeySecret不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '默认短信签名',
    dataIndex: 'signature',
    tooltip: '签名信息可前往 https://dysms.console.aliyun.com/domestic/text/sign 的签名管理查看',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '短信签名不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '接口方法',
    dataIndex: 'apiMethod',
    initialValue: 'SendSms',
    tooltip: '接口方法默认为 SendSms 如无特殊改变可以不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '接口方法不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '地域',
    dataIndex: 'range',
    initialValue: 'cn-hangzhou',
    tooltip: '地域信息默认为 cn-hangzhou 如无特殊改变可以不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '地域不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '请求地址',
    dataIndex: 'requestUrl',
    initialValue: 'dysmsapi.aliyuncs.com',
    tooltip: '请求地址默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请求地址不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '接口版本号',
    dataIndex: 'ApiVersion',
    initialValue: '2017-05-25',
    tooltip: '接口版本号默认为 2017-05-25 如无特殊改变可以不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请求地址不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
];
//华为
export const smsHuaweiColumns = [
  {
    title: 'appKey',
    dataIndex: 'appkey',
    tooltip: '华为短信应用appkey)',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'appkey不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'appSecret',
    dataIndex: 'appSecret',
    tooltip: 'appSecret',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'appSecret不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '默认短信签名',
    dataIndex: 'signature',
    tooltip: '签名信息可前往 https://dysms.console.aliyun.com/domestic/text/sign 的签名管理查看',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '默认短信签名不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '短信签名通道号',
    dataIndex: 'sender',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '短信签名通道号',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '短信状态回调',
    dataIndex: 'statusCallBack',
    tooltip: '华为云国内短信状态报告接收地',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '短信状态回调不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'APP接入地址',
    dataIndex: 'url',
    initialValue: 'https://smsapi.cn-xxxxx-4.myhuaweicloud.com:443',
    tooltip: 'APP接入地址 建立短信应用后获取到的地址',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'APP接入地址不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
];
//腾讯云
export const smsTencentColumns = [
  {
    title: 'accessKey',
    dataIndex: 'accessKey',
    tooltip:
      '腾讯云的accessKey。SecretId、SecretKey 查询: https://console.cloud.tencent.com/cam/capi',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'accessKey不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'accessKeySecret',
    dataIndex: 'accessKeySecret',
    tooltip: '腾讯云的accessKeySecret',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'accessKeySecret不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '默认短信签名',
    dataIndex: 'signature',
    tooltip:
      '签名信息可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-sign) 或<br />' +
      '[国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-sign) 的签名管理查看',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '短信签名不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '短信应用ID',
    dataIndex: 'sdkAppId',
    tooltip:
      '短信sdkAppId。应用 ID 可前往 [短信控制台](https://console.cloud.tencent.com/smsv2/app-manage) 查看',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '短信应用ID不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '地域',
    dataIndex: 'territory',
    initialValue: 'ap-guangzhou',
    tooltip: '地域信息默认为 ap-guangzhou 如无特殊改变可以不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '地域不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '请求超时时间',
    dataIndex: 'connTimeout',
    initialValue: 30,
    valueType: 'digit',
    tooltip: '请求超时时间 默认60秒',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请求超时时间不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },

  {
    title: '请求地址',
    dataIndex: 'requestUrl',
    initialValue: 'sms.tencentcloudapi.com',
    tooltip: '请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '地域不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },

  {
    title: '接口方法',
    dataIndex: 'action',
    initialValue: 'SendSms',
    tooltip: '接口方法默认为 SendSms 如无特殊改变可以不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '接口方法不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '接口版本号',
    dataIndex: 'version',
    initialValue: '2021-01-11',
    tooltip: '接口版本默认为 2021-01-11 如无特殊改变可不用设置',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请求地址不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
];
//合一短信配置
export const smsUniColumns = [
  {
    title: 'accessKeyId',
    dataIndex: 'accessKeyId',
    tooltip: '访问键标识',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请输入访问键标识',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'accessKeySecret',
    dataIndex: 'accessKeySecret',
    tooltip: '访问键秘钥 简易模式不需要配置',
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '默认短信签名',
    dataIndex: 'signature',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '短信签名不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'isSimple',
    dataIndex: 'accessKeyId',
    tooltip: '访问键标识',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '请输入访问键标识',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '简易模式',
    dataIndex: 'debug',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
    tooltip: '是否为简易模式 默认为true',
    valueType: 'select',
    valueEnum: {
      true: { text: '是', value: true },
      false: {
        text: '否',
        value: false,
      },
    },
  },
];
// 云片短信配置
export const smsYunpianColumns = [
  {
    title: 'accessKeyId',
    dataIndex: 'accessKeyId',
    tooltip: '账号唯一标识',
    valueType: 'password',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'accessKeyId不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '默认短信签名',
    dataIndex: 'signature',
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '回调地址',
    dataIndex: 'callbackUrl',
    width: 'md',
    tooltip: '云片官方回调地址，无需求可以不设置',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
];
//京东云
export const smsjdCloudColumns = [
  {
    title: 'accessKeyId',
    dataIndex: 'accessKeyId',
    tooltip: '访问键标识',
    formItemProps: {
      rules: [
        {
          required: true,
          message: 'accessKeyId不能为空',
        },
      ],
    },
    width: 'md',
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: 'accessKeySecret',
    dataIndex: 'accessKeySecret',
    width: 'md',
    tooltip: '访问键秘钥',
    dataType: 'password',
    formItemProps: {
      rules: [
        {
          required: false,
          message: 'accessKeyId不能为空',
        },
      ],
    },
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '默认短信签名',
    dataIndex: 'signature',
    width: 'md',
    formItemProps: {
      rules: [
        {
          required: false,
          message: '默认短信签名不能为空',
        },
      ],
    },
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
  {
    title: '地域信息',
    dataIndex: 'region',
    width: 'md',
    initialValue: 'cn-north-1',
    tooltip: '地域信息',
    formItemProps: {
      rules: [
        {
          required: false,
          message: '地域信息不能为空',
        },
      ],
    },
    colProps: {
      xs: 24,
      md: 12,
      lg: 12,
    },
  },
];
